// 维修管理的echarts配置
import request from "@/utils/request";

export const option_wxgl = {
  title: {
    text: '维修处理占比环形图',
    // subtext: 'Fake Data',
    left: 'center'
  },
  tooltip: {
    trigger: 'item',
    formatter: '{b} : {c} ({d}%)'
  },
  legend: {
    bottom: 10,
    left: 'center',
    // data: ['CityA', 'CityB', 'CityD', 'CityC', 'CityE']
  },
  series: [
    {
      type: 'pie',
      radius: '65%',
      center: ['50%', '50%'],
      selectedMode: 'single',
      data: [],
      emphasis: {
        itemStyle: {
          shadowBlur: 10,
          shadowOffsetX: 0,
          shadowColor: 'rgba(0, 0, 0, 0.5)'
        }
      }
    }
  ]
};

// 配件库存的echarts配置
export const option_pjsl = {
  title: {
    text: '配件数量分布柱图',
    left: "center"
  },
  legend: {
    left: "center",
    bottom: -5,
    show: false
  },
  tooltip: {
    trigger: 'axis',
    axisPointer: {
      type: 'shadow'
    }
  },
  grid: {
    left: '3%',
    right: '4%',
    bottom: '3%',
    containLabel: true
  },
  xAxis: [
    {
      type: 'category',
      data: [],
      axisTick: {
        alignWithLabel: true
      }
    }
  ],
  yAxis: [
    {
      type: 'value'
    }
  ],
  // 缩放
  dataZoom:[
    {
    　type:"inside",//详细配置可见echarts官网
      startValue:0,
      endValue:6
　　　}
  ],
  series: [
    {
      name: '入库量',
      type: 'bar',
      barWidth: '20%',
      data: [],
      itemStyle: {
        color: '#e4aaf5'
      }
    },
    {
      name: '出库量',
      type: 'bar',
      barWidth: '20%',
      data: [],
      itemStyle: {
        color: '#a21e1e'
      }
    },
    {
      name: '库存量',
      type: 'bar',
      barWidth: '20%',
      data: [],
      itemStyle: {
        color: '#7fff90'
      }
    },

  ]
};

// 用户预约数量的echarts配置
export const option_yysl = {
  title: {
    text: '预约数量变化图',
    left: 'center'
  },
  xAxis: {
    type: 'category',
    data: []
  },
  tooltip: {
    trigger: 'item',
    // formatter: '{a} <br/>{b} : {c} ({d}%)'
  },
  yAxis: {
    type: 'value'
  },
  series: [
    {
      data: [],
      type: 'line'
    }
  ]
};

// 客户投诉的echarts配置



// 查询数据请求

// 维修处理占比环形图数据
export function queryDataForEcharts_WXCLZB() {
  return request({
    url: '/system/info/queryDataForEcharts_WXCLZB',
    method: 'get',
  })
}
// 配件数量分布图数据
export function queryDataForEcharts_PJSL() {
  return request({
    url: '/system/info/queryDataForEcharts_PJSL',
    method: 'get',
  })
}
// 预约数量分布图数据
export function queryDataForEcharts_YYSL(dateYear) {
  return request({
    url: '/system/info/queryDataForEcharts_YYSL/'+dateYear,
    method: 'get',
  })
}
// 预约单，工作单，维修单分布图数据
export function queryDataForEcharts_DANZI() {
  return request({
    url: '/system/info/queryDataForEcharts_DANZI',
    method: 'get',
  })
}
